{include file="public_head"}

<script type="text/javascript" src="/static/plupload/plupload.full.min.js"></script>
{include file="public_menu"}
    <div class="content_center">
        <div class="main_center">
            <div class="main_left left">
                {include file="public_information_menu"}
            </div>
            <div class="main_right right">
                <div class="order_content">
                    <div class="center-return">
                        <div class="main_con">
                            <div class="title">申请退款</div>
                            <div class="tabcon">
                                <div id="center">
                                    <form action="{:url('MemberOrder/return_good')}" method="post" id="form">
                                    <h4>退款类型</h4>
                                    <ul class="tablist1">
                                        <li class="cur"><a href="javascript:;">我要退款<span>(无需退货)</span></a></li>
                                    </ul>
                                    <div class="tabcon1">
                                        <div class="cur">
                                            <h4>退款金额</h4>
                                            <input type="text" placeholder="请输入退款金额" class="text" name="amount" datatype="money" nullmsg="退款金额不能为空" errormsg="退款金额格式错误">
                                            <input type="hidden" name="type" class="text" value="1">
                                            <input type="hidden" name="order_id" class="text" value="{$order.id}">
                                            <h4>退款原因</h4>
                                            <textarea placeholder="请输入退款说明" class="textarea" name="cause" datatype="*" nullmsg="退款原因不能为空"></textarea>
                                            <h4>退款说明</h4>
                                            <textarea placeholder="请输入退款说明" class="textarea" name="explain" datatype="*" nullmsg="退款说明不能为空"></textarea>
                                        </div>
                                    </div>
                                    <input type="submit" value="提交申请" id="sub">
                                   </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<script>

    // 申请退款
    $(function () {
        $.Tipmsg.r = null;
        $.Tipmsg.p = null;
        $.Datatype.money = /^-?\d+\.?\d{0,2}$/;
        $('#form').Validform({
            tiptype: function (msg) {
                layer.msg(msg, {icon: 2});
            },
            tipSweep: true,
            btnSubmit: 'sub',
            // ajax 提交
            ajaxPost: true,
            callback: function (t) {
                if (t.code == 200) {
                    layer.msg('您的退款申请成功！', {icon: 1});
                    setTimeout(function () {
                        layer.closeAll('loading');
                        // 跳转页面
                        location.href = "{:url('shop/member_order/index')}";
                    }, 3000);
                } else {
                    layer.msg('网络繁忙稍后再试', {icon: 2});
                }

            }
        })
    });
</script>
{include file="public_foot"}
